﻿package frEngine.shader.filters.fragmentFilters
{
    import frEngine.shader.*;
    import frEngine.shader.filters.*;

    public class LightFilter extends FilterBase
    {
        protected var skinNum:int;

        public function LightFilter()
        {
            super(FilterType.LightFilter, FilterPriority.LightFilter);
            return;
        }// end function

        override public function setRegisterParams(param1:Program3dRegisterInstance) : void
        {
            return;
        }// end function

        override public function get programeId() : String
        {
            return "light0";
        }// end function

        override public function clone() : FilterBase
        {
            return this;
        }// end function

        override public function createVertexCode(param1:Program3dRegisterInstance, param2:int) : String
        {
            var _loc_3:Array = [new ToBuilderInfo("vf1", "{V_GloblePos}", false, 1)];
            param1.toBuild("", _loc_3);
            return "";
        }// end function

        override public function createFragmentColor(param1:Program3dRegisterInstance, param2:Boolean) : String
        {
            var _loc_3:* = new Array();
            _loc_3.push(new ToBuilderInfo("fm0", FilterName.global, true, 4));
            var _loc_4:* = "" + "m33           ft1.xyz       {vnormal}     fm0  \t\t\t\t\t\n" + "dp3           ft1.w         ft1.xyz       {dirLight}\t\t\t\t\n" + "max           ft1.x         ft1.w         {fcConst1}.x\t\t\t\n" + "mul           ft2           ft1.x         {dirColor}\t\t\t\t\n" + "add           ft2           ft2           {ambientColor}\t\t\n" + "mul           {output}      ft2           {output}\t\t\t\t\n";
            _loc_4 = param1.toBuild(_loc_4, _loc_3);
            return _loc_4;
        }// end function

    }
}
